using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Resources;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace KPIS.GERP.Models.ICM
{
	[DataContract, Table("IcmDispense")]
    public class Dispense
    {
        public Dispense()
        {
        }

		[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		[DataMember, Display(Name = "DispenseId", ResourceType = typeof(Resources.DispenseResource))]
        public int DispenseId { get; set; }
        [DataMember]
        public string Code { get; set; }

        [DataMember, Display(Name = "DispenseName", ResourceType = typeof(Resources.DispenseResource))]
        public string DispenseName { get; set; }

		[DataMember, Display(Name = "DispenseDate", ResourceType = typeof(Resources.DispenseResource))]
        public Nullable<System.DateTime> DispenseDate { get; set; }

        [ForeignKey("Warehouse")]
		[DataMember, Display(Name = "WhId", ResourceType = typeof(Resources.DispenseResource))]
        public int? WhId { get; set; }

		[ForeignKey("FromJobSite")]
		[DataMember, Display(Name = "JobSiteId", ResourceType = typeof(Resources.DispenseResource))]
        public int FromJobSiteId { get; set; }
        
        [ForeignKey("RequestParcel")]
        [DataMember, Display(Name = "RequestParcelId", ResourceType = typeof(Resources.DispenseResource))]
        public int RequestParcelId { get; set; }

        [ForeignKey("Project")]
        [DataMember, Display(Name = "ProjectId", ResourceType = typeof(Resources.DispenseResource))]
        public int? ProjectId { get; set; }

        [ForeignKey("Employee")]
        [DataMember, Display(Name = "RequestById", ResourceType = typeof(Resources.DispenseResource))]
        public int RequestById { get; set; }

		[DataMember, Display(Name = "Remark", ResourceType = typeof(Resources.DispenseResource))]
        public string Remark { get; set; }

		[DataMember, Display(Name = "ApprovedBy", ResourceType = typeof(Resources.DispenseResource))]
        public Nullable<int> ApprovedBy { get; set; }

		[DataMember, Display(Name = "ApprovedWhen", ResourceType = typeof(Resources.DispenseResource))]
        public Nullable<System.DateTime> ApprovedWhen { get; set; }

        [StringLength(2)]
        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.DispenseResource))]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.DispenseResource))]
        public Nullable<int> CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.DispenseResource))]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

		[DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.DispenseResource))]
        public Nullable<int> UpdatedBy { get; set; }

		[DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.DispenseResource))]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }


        [DataMember]
        public virtual Warehouse Warehouse { get; set; }

        [DataMember]
        public virtual HRM.JobSite FromJobSite { get; set; }

        [DataMember]
        public virtual HRM.Employee Employee { get; set; }
        
        [DataMember]
        public virtual RequestParcel RequestParcel { get; set; }

        [DataMember]
        public virtual BGM.Project Project { get; set; }
    }
}